package com.itheima.test8;

import java.io.InputStream;
import java.io.PrintStream;

public class Test {


    public static void main(String[] args) {


        new Fu(){
            private int y=30;
            @Override
            public void sing(){
                System.out.println("匿名内部类 sing");
            }

        }.sing();
        new Inter() {
            @Override
            public void sing() {

            }
        }.sing();
        Inter inter= ()->System.out.println("lambda表达式sing");
       inter.sing();
    }
}


class Fu{
    int i=10;
    public Fu(){

    }

    public void sing(){
        System.out.println("sing");
    }

}
class Zi extends Fu{
    private int x=20;
    public Zi(){
        super();
    }
    @Override
    public void sing(){
        System.out.println("Zi sing");
    }
}
interface  Inter{

     void sing();
}